import Vue from 'vue';
import Vuex from 'vuex';
Vue.use(Vuex)

const actions = {
  jia(miniStore,value){
      miniStore.commit('JIA',value)
  },
  jian(miniStore,value){
    miniStore.commit('JIAN',value)
}
}

 const mutations = {
    JIA(state,value){
        state.sum += value
    },
    JIAN(state,value){
        state.sum -= value
    }
 }
//  state用于存储数据
 const state ={
     sum:0
 }
  
export default new Vuex.Store({
    actions,
    mutations,
    state
})